import React from 'react'

function useDebounce(cb, time = 400) {
    let timer = null
    if (timer) {
        clearTimeout(timer)
    }
    timer = setTimeout(() => {
        cb && cb()
    }, time)

}

export default useDebounce